﻿using System;
using DNT.RavenQA.Core.Extensions;
using Xunit;

namespace DNT.RavenQA.Core.Tests.Extensions
{
    public class StringExtensionsTests
    {
        [Fact]
        public void NullOrEmpty()
        {
            Assert.True(String.Empty.IsNullOrEmpty());
            Assert.True(" ".IsNotNullOrEmpty());
            Assert.Throws<ArgumentNullException>(() =>
                                                     {
                                                         String s = null;
                                                         s.EnsureIsNotNullOrEmpty();
                                                     });
            Assert.Throws<ArgumentOutOfRangeException>(() => String.Empty.EnsureIsNotNullOrEmpty());
        }
    }
}